package com.example.app;

import android.app.Activity;
import android.app.ActionBar;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.os.Build;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;

public class ConteudoNoticia extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_conteudo_noticia);
        setTitle("Notítica");

        if (savedInstanceState == null) {
            Bundle extras;
            extras = getIntent().getExtras();

            TextView title = (TextView)findViewById(R.id.title_text);
            TextView content = (TextView)findViewById(R.id.contentText);
            TextView font = (TextView)findViewById(R.id.font_text);
            Button backBtn = (Button)findViewById(R.id.bck_btn);
            ImageButton gmailBtn = (ImageButton)findViewById(R.id.gmail_btn);
            ImageButton twitterBtn = (ImageButton)findViewById(R.id.twitter_btn);
            ImageButton faceBtn = (ImageButton)findViewById(R.id.face_btn);

            backBtn.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    ConteudoNoticia.this.finish();
                    overridePendingTransition(R.anim.slide_in, R.anim.slide_out);
                }
            });

            title.setText(extras.getString("TITLE"));
            content.setText(extras.getString("CONTENT"));
            font.setText(extras.getString("FONT"));

            gmailBtn.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Toast.makeText(getApplicationContext(),"Notícia Enviada para o seu e-mail! :-)",Toast.LENGTH_SHORT).show();
                }
            });
            twitterBtn.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Toast.makeText(getApplicationContext(),"Retweet! :-)",Toast.LENGTH_SHORT).show();
                }
            });
            faceBtn.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Toast.makeText(getApplicationContext(),"Notícia Compartilhada no seu Mural! :-)",Toast.LENGTH_SHORT).show();
                }
            });
        }
        overridePendingTransition(R.anim.slide_in, R.anim.slide_out);
    }

    public void onBackPressed(){
        super.onBackPressed();
        overridePendingTransition(R.anim.slide_in, R.anim.slide_out);
    }
}
